package com.eig.courseweb.controller;

import com.eig.common.vo.Result;
import com.eig.courseweb.service.SubjectService;
import com.eig.courseweb.vo.CourseVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import javax.annotation.Resource;

/**
 * @author ：StudentLsj（李世界）
 * @date ：Created in 2023/01/12 下午 02:39
 * @description：
 * @modified By：
 * @version:
 */
@RestController
@RequestMapping("core/subject")
@Api(tags = "修改时下拉框回显")
@EnableSwagger2
public class SubjectController {

    @Resource
    private SubjectService subjectService;

    @GetMapping("/findPidByid/{pid}")
    @ApiOperation(value = "根据父id查询其父亲的父id,,如果为0表示为2级下拉框，，否则就是三级下拉框，，")
    public Result findPidByid(@PathVariable String pid) {
        return subjectService.findPidByid(pid);
    }

    @PostMapping("/findsubjectByStatus")
    @ApiOperation(value = "填充下拉框")
    public Result findsubjectByStatus() {
        return subjectService.findsubjectByStatus();
    }
    @GetMapping("/findsubject")
    @ApiOperation(value = "填充下拉框")
    public Result findsubject() {
        return subjectService.findsubjectByStatus();
    }
}
